{if $GLOBALS.is_ajax || $smarty.get.ajax_submit}
	{foreach from=$errors key=key item=error}
		{if $key == 'NOT_SUPPORTED_VIDEO_FORMAT' || $key == 'NOT_ACCEPTABLE_FILE_FORMAT'}
			<p class="error">[[Not supported video format]]</p>
		{elseif $key === 'UPLOAD_ERR_INI_SIZE'}
			<p class="error">[[File size exceeds system limit. Please check the file size limits on your hosting or upload another file.]]</p>
		{else}
			<p class="error">{$key}</p>
		{/if}
	{/foreach}

	<input id="autoloadFileSelect_{$id}"
			field_id="{$id}"
			field_action="upload_profile_video"
			field_target="video_field_content_{$id}"
			type="file"
			name="{if $complexField}{$complexField}[{$id}][{$complexStep}]{else}{$id}{/if}"
			class="inputVideo autouploadField {if $complexField}complexField{/if}"
			{if $value.file_url}style="display:none;"{/if} />

	{if $value.file_url}
		<div id="user_video_{$id}" style="float:left;">
			<div id="video_container_{$id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
			<script type="text/javascript" src="{$GLOBALS.user_site_url}/files/video/swfobject.js"></script>
			<div>
				<script type="text/javascript">
					var s1 = new SWFObject("{$GLOBALS.user_site_url}/files/video/player.swf","ply","250","250","9","#FFFFFF");
					s1.addParam("allowscriptaccess","always");
					s1.addParam("allowfullscreen","true");
					s1.addParam("wmode", "opaque");
					s1.addParam("flashvars","file={$value.file_url}&image={$value.file_url|regex_replace:"/flv/":"png"}&fullscreen=true");
					s1.write("video_container_{$id}");
				</script>
				<br />
				<a class="delete_profile_video"
					field_id="{$id}"
					file_id="{$value.file_id}"
					user_sid="{$user_info.sid}"
					href="{$GLOBALS.site_url}/users/delete-uploaded-file/?field_id={$id}">[[Remove]]</a>
			</div>
			<br />
		</div>
		<span id="extra_field_info_{$id}" style="display:none;"><small>([[max.]] {$uploadMaxFilesize} M)</small></span>
	{else}
		<small>([[max.]] {$uploadMaxFilesize} M)</small>
	{/if}

	<input type="hidden" name="user_group_id" value="{if isset($GLOBALS.current_user.group.id)}{$GLOBALS.current_user.group.id}{else}{$params.user_group_id}{/if}" />
{else}
	<div id="video_field_content_{$id}">
		<input id="autoloadFileSelect_{$id}"
				field_id="{$id}"
				field_action="upload_profile_video"
				field_target="video_field_content_{$id}"
				type="file"
				name="{if $complexField}{$complexField}[{$id}][{$complexStep}]{else}{$id}{/if}"
				class="inputVideo autouploadField {if $complexField}complexField{/if}"
				{if $value.file_url}style="display:none;"{/if} />

		<input type="hidden" name="user_group_id" value="{if isset($GLOBALS.current_user.group.id)}{$GLOBALS.current_user.group.id}{else}{$params.user_group_id}{/if}" />

		{if $value.file_url}
			<div id="user_video_{$id}" style="float:left;">
				<div id="video_container_{$id}"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</div>
				<script type="text/javascript" src="{$GLOBALS.user_site_url}/files/video/swfobject.js"></script>
				<div>
					<script type="text/javascript">
						var s1 = new SWFObject("{$GLOBALS.user_site_url}/files/video/player.swf","ply","250","250","9","#FFFFFF");
						s1.addParam("allowscriptaccess","always");
						s1.addParam("allowfullscreen","true");
						s1.addParam("wmode", "opaque");
						s1.addParam("flashvars","file={$value.file_url}&image={$value.file_url|regex_replace:"/flv/":"png"}&fullscreen=true");
						s1.write("video_container_{$id}");
					</script>
					<br />
					<a class="delete_profile_video"
						field_id="{$id}"
						file_id="{$value.file_id}"
						user_sid="{$user_info.sid}"
						href="{$GLOBALS.site_url}/users/delete-uploaded-file/?field_id={$id}&form_token={$form_token}">[[Remove]]</a>
				</div>
				<br />
			</div>
			<span id="extra_field_info_{$id}" style="display:none;"><small>([[max.]] {$uploadMaxFilesize} M)</small></span>
		{else}
			<small>([[max.]] {$uploadMaxFilesize} M)</small>
		{/if}
	</div>
{/if}